@layout("/common/_vContainer.html"){
<div id="app">
    <el-row :gutter="20">
        <el-col :span="6">
            <div class="card">
                <div class="p-tb-10 f-w-700">教师任课管理</div>
            </div>
        </el-col>
        <el-col :span="18">
            <div class="card">
                <el-button type="success" v-on:click="location.reload()"><i class="el-icon-refresh"></i> 刷新</el-button>
                <el-button type="primary" v-on:click="gen()"><i class="el-icon-circle-plus"></i> 添加</el-button>
                <el-button type="primary" v-on:click="gen()"><i class="el-icon-circle-plus"></i> 随机生成所有学生成绩</el-button>
                @if(shiro.hasPermission("/subject/add")){
                <!--<el-button type="warning" v-on:click="modal.upload = true"><i class="el-icon-upload"></i> Excel上传成绩</el-button>-->
                @}
            </div>
        </el-col>
    </el-row>
    <div class="card">
        <el-row>
            <!--<div>本学期任教科目:</div>-->
            <!--<div><el-tag>学前教育(专业)- 3年制 - 2014级1班 - 幼儿教师口语1</el-tag> <el-button size="mini" type="warning" v-on:click="modal.upload = true">上传成绩</el-button></div>-->
            <!--<div class="m-t-4"><el-tag>学前教育(专业)- 3年制 - 2014级1班 - 大学英语1</el-tag> <el-button size="mini" type="warning" v-on:click="modal.upload = true">上传成绩</el-button></div>-->
            <el-form>
                <el-row :gutter="10">
                    <el-col :span=5>
                        <el-form-item>
                            <div>专业名</div>
                            <el-select placeholder="专业名" value="学前教育"></el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="5">
                        <el-form-item>
                            <div>科目名</div>
                            <el-select placeholder="科目名" value=""></el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="5">
                        <el-form-item label="年级">
                            <el-input placeholder="年级" value="3年制-2014年级"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="5">
                        <el-form-item label="班别">
                            <el-input placeholder="班别" value="1班"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="4">
                        <!--<el-button size="mini" type="primary">继续添加</el-button>-->
                        <!--<el-button size="mini" type="warning">分析统计</el-button>-->
                    </el-col>
                </el-row>
            </el-form>
        </el-row>
    </div>
    <div class="card">
        <el-row>
            <el-form :model="condition" :inline="true">
                <el-form-item label="关键字">
                    <el-input placeholder="教师姓名 、教工号" v-model="condition.key"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" v-on:click="query">查询</el-button>
                </el-form-item>
            </el-form>
        </el-row>
        <el-table :data="page.data" highlight-current-row style="width: 100%">
            <el-table-column type="index" width="45"></el-table-column>
            <el-table-column property="stuName" label="姓名"></el-table-column>
            <el-table-column property="stuNo" label="教工号"></el-table-column>
            <el-table-column property="subjectName" label="课程"></el-table-column>
            <el-table-column property="subjectTerm" label="学期"></el-table-column>
            <el-table-column property="clazz" label="班级"></el-table-column>
            <!--<el-table-column property="score" label="分数"></el-table-column>-->
            <el-table-column label="操作">
                <template slot-scope="scope">
                    @if(shiro.hasPermission("/subject/update")){
                    <el-button type="info" size="mini" v-on:click="toUpdate(scope.row)">编辑</el-button>
                    @}
                    @if(shiro.hasPermission("/subject/delete")){
                    <el-button type="danger" size="mini" v-on:click="doDelete(scope.row.id)">删除</el-button>
                    @}
                </template>
            </el-table-column>
        </el-table>
        <el-row class="m-t-20 text-center">
            <el-pagination background layout="total,prev,pager,next" :page-size="page.pageSize" :total="page.total" :current-page.sync="page.pageIndex" v-on:current-change="query"></el-pagination>
        </el-row>
    </div>

    <!--上传学生成绩excel-->
    <el-dialog :visible.sync="modal.upload" title="Excel - 上传成绩" width="50%" :modal-append-to-body="false" top="30vh">
        <el-row>
            <div class="text-center">参考格式</div>
            <el-table border>
                <el-table-column label="学号"></el-table-column>
                <el-table-column label="课程名称"></el-table-column>
                <el-table-column label="成绩"></el-table-column>
                <el-table-column label="学期"></el-table-column>
            </el-table>
        </el-row>
        <el-row class="m-t-20">
            <el-upload
                    class="upload-demo"
                    ref="upload"
                    name="file"
                    action="/score/upload"
                    accept=".xls,.xlsx"
                    :multiple="false"
                    :on-preview="handlePreview"
                    :on-remove="handleRemove"
                    :file-list="fileList"
                    :auto-upload="false">
                <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
                <el-button style="margin-left: 10px;" size="small" type="success" v-on:click="submitUpload">上传到服务器</el-button>
                <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
            </el-upload>
        </el-row>
        <div slot="footer" class="text-right">
            <el-button v-on:click="modal.upload = false">取 消</el-button>
        </div>
    </el-dialog>

</div>
<script src="${ctxPath}/static/modular/edu/score/score.js"></script>
@}
